package com.onlinelibrary.activities.main.ui.me;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;

import com.onlinelibrary.BR;
import com.onlinelibrary.R;
import com.onlinelibrary.databinding.FragmentMeBinding;
public class MeFragment extends Fragment {
    private MeVM vm;
    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_me, container, false);
        FragmentMeBinding binding = DataBindingUtil.bind(root);
         vm = new ViewModelProvider(this).get(MeVM.class);
        assert binding != null;
        binding.setVariable(BR.vm,vm);
        binding.setLifecycleOwner(this);
        vm.setBinding(binding,this,requireActivity());
        return root;
    }
    @Override
    public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        vm.onActivityResult(resultCode);
    }
}
